<form id="Form" method="post" action="<? echo base_url().'index.php/capacitacion/enviar_capacitaciones'?>">
	<div class="row"> 
		<div class="col-lg-8"> 
				<button class="btn btn-info "  id="btn-programar">Programar</button><br><br>
		</div>
		<div class="col-lg-3"> 
				Selecionar/Deselecionar todo &nbsp; <input  type="checkbox"  value="-1" onClick="chequear(this);"/> 
		</div>
	</div>

	<input name="id_edicion" type="hidden" value="<?=$id_edicion;?>"/>


<!-- BEGIN DATA TABLE -->
					<div class="the-box">
						<div class="table-responsive">

						<table class="table table-striped table-hover" id="datatable-local">
							<thead class="the-box dark full">
								<tr>
									<th>ID Capacitacion</th>
									<th>Capacitacion</th>
									<th>Areá</th>
									<th>Cantidad de solicitudes</th>
									<th>Opciones</th>
								</tr>
							</thead>
							<tbody>
								<?php 	foreach ($d as $f) {?>										

								<tr class="odd gradeX">
									<td><?php echo $f['id_capacitacion'];?></td>
									<td><?php echo $f['nombre'];?></td>
									<td><?php echo $f['area'];?></td>
									<td><?php echo $f['cant'];?></td>
									<td class="center">
										<!-- <button class="btn btn-default btn-xs"><i   class="fa fa-pencil-square-o fa-2x" data-id_dato="<?php echo $f['id_capacitacion'];?>" onclick="modificar(this)" data-toggle="tooltip" data-original-title="Modificar"></i></button> -->									
										<?php 
											if ($f['estado']==1) {
												echo $f['estadot'];
											}else{ ?>
												<input value="<?php echo $f['id_capacitacion'];?>" type="checkbox" name="selecion[]" class="selecion"/>
											<? }?>
									</td>
								</tr>
							
								<?php }	?>
							</tbody>
						</table>
						</div><!-- /.table-responsive -->
					</div><!-- /.the-box .default -->
					<!-- END DATA TABLE -->
		</form>	
	</div><!-- /.container-fluid -->
<script type="text/javascript">
	function chequear(e) {
		var marcado = $(e).prop("checked") ? true : false;		
		$(".selecion").each(function( key, value ) { ///para cada pregunta	   				
				$(value).prop("checked",marcado);
		});
	}
	$('#datatable-local').dataTable({
		 aaSorting: [[3, 'desc']],
	});
</script>
